from django.db import models


# Create your models here.
class Book(models.Model):
    book_id = models.AutoField(primary_key=True, verbose_name='ID')
    book_name = models.CharField(max_length=100, default='', verbose_name='名称')
    book_price = models.DecimalField(max_length=100, default='', decimal_places=20, max_digits=25,
                                     verbose_name='价格')
    book_count = models.DecimalField(max_length=100, default='', decimal_places=20, max_digits=25,
                                     verbose_name='书籍数量')
    book_type_id = models.CharField(max_length=100, default='', verbose_name='类别ID')
    book_publish = models.CharField(max_length=100, default='', verbose_name='出版社')
    book_publish_date = models.DateTimeField(auto_now=True, verbose_name='出版日期')
    book_introduction = models.CharField(max_length=4000, default='', verbose_name='图书简介')
    book_image_path = models.CharField(max_length=1000, default='', verbose_name='图书图片')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        db_table = 't_book'
        verbose_name = '图书'
        verbose_name_plural = verbose_name
